$(function(){
	var totalCount = $('#totalCount').val();
	if(totalCount > 0) {
		pages(method);
	}
 })
/**
 * 分頁處理
 */
function pages(method){
	var pageNo = $('#pageNo').val();
	var pageSize = $('#pageSize').val();
	var totalCount = $('#totalCount').val();
	var totalPages = $('#totalPages').val();
	
	var displayNo = 0;
	if(totalPages>=5){
		displayNo = 5;
	}else{
		displayNo = totalPages;
	}
	$("#pagination").paginate({
		count: totalPages,
		start : 1,
		display :displayNo,
		border : false,
		// border_color : '#ddd',
		text_color : '#337ab7',
		background_color : 'transparent',
		border_hover_color : 'transparent',
		text_hover_color : '#fff',
		background_hover_color : '#337ab7',
		images : false,
		mouse : 'slide',
		onChange:function(p){
			$('#pageNo').val(p);
			method();
		}
	});
}